Conversation
Vdaleke
left a comment
There was a problem hiding this comment.
Добавить github-actions с проверками clang-format и clang-tidy. Сделать нормальное название PR и наполнить description.
Vdaleke
left a comment
There was a problem hiding this comment.
В общем и целом нормально, просто надо убрать лишнее и переделать cmake
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| # Шаг 1: Checkout репозитория |
There was a problem hiding this comment.
Убрать комментарии на русском языке
| steps: | ||
| # Шаг 1: Checkout репозитория | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 |
There was a problem hiding this comment.
есть версия actions/checkout@v4, проапгрейдить
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y clang-format clang-tidy libboost-all-dev \ |
There was a problem hiding this comment.
оставить только нужные зависимости, e.g. clang-format
| nlohmann-json3-dev libpqxx-dev | ||
|
|
||
| # Шаг 3: Установка TgBot | ||
| - name: Install TgBot |
| sudo make install | ||
|
|
||
| # Шаг 4: Кэширование директории сборки | ||
| - name: Cache Build Directory |
There was a problem hiding this comment.
давай пока без кеширования, если понадобится, добавим по гайду от cpm-cmake
CMakeLists.txt
Outdated
|
|
||
| include_directories(include) | ||
|
|
||
| file(GLOB SOURCES source/*.cpp) |
There was a problem hiding this comment.
| file(GLOB SOURCES source/*.cpp) | |
| # ---- Add source files ---- | |
| # Note: globbing sources is considered bad practice as CMake's generators may not detect new files | |
| # automatically. Keep that in mind when changing files, or explicitly mention them here. | |
| file(GLOB_RECURSE headers CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h") | |
| file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp") |
CMakeLists.txt
Outdated
|
|
||
| file(GLOB SOURCES source/*.cpp) | ||
|
|
||
| add_executable(main ${SOURCES}) |
There was a problem hiding this comment.
давай executable, который будет запускать бота на сервере будет лежать в отдельной папке apps, как это описано здесь и сделано здесь
при этом у вас в проекте будет два проекта: библиотека и приложение запускающее эту библиотеку на сервере.
В это CMakeLists.txt будет конфигурация основного проекта - библиотеки.
Сделаем вот так:
# ---- Create library ----
add_library(${PROJECT_NAME} ${headers} ${sources})
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20)
CMakeLists.txt с executable можешь создать уже в своем PR
| ```sh | ||
| git clone git@github.com:EntryPoint-C-project/EntryPoint.git | ||
| cd EntryPoint | ||
| # You need to make a telegram-bot token |
There was a problem hiding this comment.
лучше одной командой. и клонировать репозиторий и перейти в него это spoon-feeding, лучше не надо. Давай так:
Clone repository, go to the directory and run:
...sh
cmake -S . -B build && cmake --build build
...
| ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} | ||
| ) | ||
|
|
||
| include(${CPM_DOWNLOAD_LOCATION}) No newline at end of file |
There was a problem hiding this comment.
давай здесь тоже последнюю строчку добавим чтоб гитхаб не ругался
There was a problem hiding this comment.
потом не забыть удалить, так как по факту файлики эти не нужны
| @@ -0,0 +1,22 @@ | |||
| cmake_minimum_required(VERSION 3.14 FATAL_ERROR) | |||
|
|
|||
| project(MyProject LANGUAGES CXX) | |||
There was a problem hiding this comment.
| project(MyProject LANGUAGES CXX) | |
| project(EntryPoint LANGUAGES CXX) |
|
|
||
| project(MyProject LANGUAGES CXX) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 20) |
There was a problem hiding this comment.
не нужно, ты уже устанвливаешь настройку в 19 строчке для target-а.
|
|
||
| set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 OUTPUT_NAME "MyApp") | ||
|
|
||
| target_include_directories(${PROJECT_NAME} PUBLIC include) |
There was a problem hiding this comment.
target_include_directories(
${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}-${PROJECT_VERSION}>
)
|
|
||
| add_library(${PROJECT_NAME} ${headers} ${sources}) | ||
|
|
||
| set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 OUTPUT_NAME "MyApp") |
No description provided.